home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 726-750 / 742 / rkrm_lib3 / rkrm_lib3.lha / Math / sptrans.c < prev   
C/C++ Source or Header  |  1992-09-03  |  2KB  |  61 lines

  1. ;/* sptrans.c - Math SP IEEE Transcendental example of SPCos(). Run from CLI only!
  2. LC -b1 -cfist -fi -v -y -j73 sptrans.c
  3. Blink lib:c.o+sptrans.o TO sptrans LIB lib:lcmieee.lib+lib:lc.lib+lib:amiga.lib
  4. quit
  5. */
  6.  
  7. /*
  8. Copyright (c) 1992 Commodore-Amiga, Inc.
  9.  
  10. This example is provided in electronic form by Commodore-Amiga, Inc. for
  11. use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
  12. published by Addison-Wesley (ISBN 0-201-56774-1).
  13.  
  14. The "Amiga ROM Kernel Reference Manual: Libraries" contains additional
  15. information on the correct usage of the techniques and operating system
  16. functions presented in these examples.  The source and executable code
  17. of these examples may only be distributed in free electronic form, via
  18. bulletin board or as part of a fully non-commercial and freely
  19. redistributable diskette.  Both the source and executable code (including
  20. comments) must be included, without modification, in any copy.  This
  21. example may not be published in printed form or distributed with any
  22. commercial product.  However, the programming techniques and support
  23. routines set forth in these examples may be used in the development
  24. of original executable software products for Commodore Amiga computers.
  25.  
  26. All other rights reserved.
  27.  
  28. This example is provided "as-is" and is subject to change; no
  29. warranties are made.  All use is at your own risk. No liability or
  30. responsibility is assumed.
  31. */
  32.  
  33. #include <exec/types.h>
  34.  
  35. #include <clib/exec_protos.h>
  36. #include <libraries/mathieeesp.h>
  37.  
  38. #include <clib/mathieeesingtrans_protos.h>
  39. #include <clib/alib_stdio_protos.h>
  40.  
  41. struct Library *MathIeeeSingTransBase;
  42.  
  43. VOID main(void)
  44. {
  45.  
  46. FLOAT num1= 3.1415926535897;
  47. FLOAT result;
  48.  
  49. if (MathIeeeSingTransBase = OpenLibrary("mathieeesingtrans.library",34))
  50.  
  51.  
  52.     {
  53.     result = IEEESPCos(num1);
  54.     printf("The single precision cosine of 30 degrees is %f\n",result);
  55.  
  56.     CloseLibrary(MathIeeeSingTransBase);
  57.     }
  58. else
  59.     printf("Can't open mathieeesingtrans.library\n");
  60. }
  61.